<template>
  <div class="block">
    <el-carousel trigger="click" height="210px">
      <el-carousel-item v-for="(item, index) in banner" :key="index">
        <img :src="item.imgUrl" alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  data() {
    return {
      banner: [],
    };
  },
  mounted() {
    this.$http("http://47.108.197.28:4000/api/banner").then((res) => {
      this.banner = res.data.res;
    });
  },
};
</script>

<style scoped>
.block {
  width: 10rem;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  margin: 0;
}
img {
  width: 10rem;
}
</style>
